﻿using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;
using T.FAS.Runtime.Base.Entity;

namespace T.FAS.Runtime.Expression.Entity
{
    /// <summary>
    /// 表达式项
    /// </summary>
    [Serializable]
    [DataContract]
    public class ExprItem
    {
        /// <summary>
        /// 主键
        /// </summary>
        [DataMember]
        public string ID { get; set; }
        /// <summary>
        /// 时间戳
        /// </summary>
        public DateTime LastModifyTime { get; set; }
        /// <summary>
        /// 语义化名称
        /// </summary>
        [DataMember]
        public string DisplayName { get; set; }
        /// <summary>
        /// 引用表达式
        /// </summary>
        [DataMember]
        public string RefSchemaExpr { get; set; }
        /// <summary>
        /// 引用表达式值
        /// </summary>
        [DataMember]
        public string RefSchemaExprValue { get; set; }
        /// <summary>
        /// 标识
        /// </summary>
        [DataMember]
        public string Code { get; set; }
        /// <summary>
        /// 名称
        /// </summary>
        [DataMember]
        public string Name { get; set; }
        /// <summary>
        /// 引擎类型 -1全部 0解释型 1出码型
        /// </summary>
        [DataMember]
        public int EngineType { get; set; } = -1;
        /// <summary>
        /// 表达式项类型
        /// </summary>
        [DataMember]
        public ItemType ItemType { get; set; }
        /// <summary>
        /// Action返回值类型
        /// </summary>
        [DataMember]
        public string DataResultType { get; set; }
        /// <summary>
        /// 数据类型
        /// </summary>
        [DataMember]
        public DataType ValueType { get; set; }
        /// <summary>
        /// 帮助信息
        /// </summary>
        [DataMember]
        public string HelpInfo { get; set; }
        /// <summary>
        /// 排序
        /// </summary>
        public int SortOrder { get; set; }
        /// <summary>
        /// 表达式元数据ID
        /// </summary>
        [DataMember]
        public string ExprMetaDataID { get; set; }
        /// <summary>
        /// 表达式元数据别名
        /// </summary>
        [DataMember]
        public string ExprMetaDataAlias { get; set; }
        /// <summary>
        /// 父ID
        /// </summary>
        public string ParentID { get; set; }
        /// <summary>
        /// List Record MetaDataID
        /// </summary>
        [DataMember]
        public string DataModels { get; set; }
        /// <summary>
        /// 是否叶子节点
        /// </summary>
        [DataMember]
        public bool IsLeaf { get; set; }
        /// <summary>
        /// 是否删除
        /// </summary>
        [DataMember]
        public bool IsDelete { get; set; }
        /// <summary>
        /// 扩展属性
        /// </summary>
        [DataMember]
        public object ExprExt { get; set; }
        /// <summary>
        /// 子表达式
        /// </summary>
        [DataMember]
        public List<ExprItem> Children { get; set; } = new List<ExprItem>();
        /// <summary>
        /// 表达式函数参数
        /// </summary>
        [DataMember]
        public List<ExprFuncItemParam> ExprFuncItemParamList { get; set; } = new List<ExprFuncItemParam>();
    }
}
